0b7aae7d9c9a12cfdeeb02306144ea43d57aa053,modules/wyc/src/wyc/builder/CodeGenerator.java,CodeGenerator,generateTypeCondition,#String#Expr.BinOp#Environment#CodeForest.Block#CodeForest#Context#,1489
Before Change
// following cast is always safe.
Expr.TypeVal rhs = (Expr.TypeVal) condition.rhs;
block.add(Bytecode.IfIs(condition.srcType.raw(), leftOperand, rhs.type.nominal(), target), attributes(condition));
}
/**
After Change
if (environment.get(lhs.var) == null) {
syntaxError(errorMessage(UNKNOWN_VARIABLE), context, condition.lhs);
}
leftOperand = environment.get(lhs.var);
} else {
// This is the general case whether the lhs is an arbitrary variable
// and, hence, retyping does not apply. Therefore, we can simply
// evaluate the lhs into a temporary register as per usual.
leftOperand = generate(condition.lhs, environment, block, forest, context);
}
// Note, the type checker guarantees that the rhs is a type val, so the
// following cast is always safe.
Expr.TypeVal rhs = (Expr.TypeVal) condition.rhs;
block.add(new Bytecode.IfIs(condition.srcType.raw(), leftOperand, rhs.type.nominal(), target), attributes(condition));
}
/**